<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
  <title>user stories detail</title>
  <meta name="description" content="">
  <meta name="keywords" content="scrum,agile,project management">
  <meta http-equiv="Content-Type"
 content="text/html; charset=iso-8859-1">
    <style type="text/css">
		<%@ include file="/WEB-INF/css/style.css" %>
	</style>
	<script src="jquery-1.4.4.min.js"> </script>
	<script type="text/javascript">
	$(document).ready(function () {
        $('#close').click(function () {
            window.opener.location.reload();
            window.close();
        });
    });
	</script>


</head>
<body onunload="window.opener.location.reload();">
<div class="page-inpop">
<div class="pagepop">
<div class="main">
<div class="contentpop">
	<h2 class="sidebar1">User Stories management</h2>
	        <form action="UserStoriesDetail" method="post">
				<input type="hidden" name="ustid" value="${selectUserStory.id}"/>
	 				<b>Name: <input type="text" name="name" value="${selectUserStory.name}"></b><br/>
	 				<b>Description: <input type="text" name="description" value="${selectUserStory.description}"></b><br/>
	 				<b>Story Points: <input type="text" name="estimatedstoryPoints" value="${selectUserStory.estimatedstoryPoints}"></b><br/>
	 				<p>Category: </p>
	 				<c:forEach items="${categories}" var="category">
						<c:choose>
		       				<c:when test="${selectUserStory.category == category.id}">
			    				<p><input type="radio" name="category" value="${category.getId()}" checked="checked"/>${category.getCategory()}</p>
						    </c:when>
						    <c:otherwise>
						        <p><input type="radio" name="category" value="${category.getId()}"/>${category.getCategory()}</p>
						    </c:otherwise>
						</c:choose>
		   			</c:forEach>
 				</p>
 				<input id=plus type="submit" name="action" value="Add"/>
 				<c:if test="${selectUserStory!=null}"><input id=edit type="submit" name="action" value="Update"/></c:if>
 				
 				
           	<c:if test="${selectUserStory!=null && selectUserStory.user == null && selectUserStory.state == \"Created\"}">   
       			<input id=assign type="submit" name="action" value="Assign"/>
       		</c:if>
       		<c:if test="${selectUserStory!=null && selectUserStory.user == null && selectUserStory.state == \"Created\" && rol == \"ScrumMaster\"}">   
       			<input id=assignto type="submit" name="action" value="AssignTo"/>
       			<c:forEach items="${users}" var="user">
       				<li class="list2">
       					<input type="radio" name="user" value="${user.id}"/>${user.fullName} - ${user.currentRol}</p>
       				</li>
				</c:forEach>   
       		</c:if>
					   		
					   		
					<p align="right"><input type='button' id='close' value='Close' /></p>
</div>
</div>
</div>
</div>
</body>
</html>